<template>
	<div>
		<div>
			<!-- <el-form :inline="true" class="demo-form-inline">
				<el-form-item class="lh" label=""><el-input placeholder="文章标题"></el-input></el-form-item>
				<el-form-item class="lh" label=""><el-date-picker type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="发布时间"></el-date-picker></el-form-item>
			</el-form> -->
		</div>
		<div>
			<el-table :data="this.tableData" style="width: 100%" @row-click='cz' >
				<el-table-column prop="id" label="ID" >
					<!-- <template slot-scope="scope">
					   <router-link to="/loginZJ/neirongZJ" @click.native='cz(scope.row.id-1)'>{{id}}</router-link>
					  </template> -->
				</el-table-column>
				<el-table-column prop="title" label="文章标题" width="200"></el-table-column>
				<el-table-column prop="create_by" label="发布人" width="200"></el-table-column>
				<el-table-column prop="publish_time" label="发布日期" width="300" ></el-table-column>
			</el-table>
		</div>
	</div>
</template>

<script>
export default {
	name: 'cgxZJ',
	data() {
		return {
			id:'',
			tableData: [],
		};
	},
	mounted() {
		let that = this;
		// (this.id = this.$route.query.id),
		this.id = localStorage.getItem('id');
		this.$axios
			.post('http://localhost:8080/selectdat/DataExpert')
			.then(function(response) {
				console.log(response.data[0].id + "22222");
				for (var a = 0; a < response.data.length; a++) {
					that.tableData.push(response.data[a]);
				}
				console.log(that.tableData[0].id);
			})
			.catch(function(error) {
				console.log(error);
			});
	},
	methods:{
		cz(row, event, column) {   
　　　　　　console.log(row,  event,  column);
			console.log(row);
			console.log(event);
			console.log(column);
			let a=row.id;
			alert(a)
			 this.$router.push({'path':'/loginZJ/neirongZJ'});
			localStorage.setItem('index',a);
		}
	}
};
</script>

<style scoped lang="less">
.demo-form-inline {
	width: 100%;
	height: 60px;
	.lh {
		margin-top: 10px;
	}
}
</style>
